package crawler;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;

public class ParsedStuff {
	private URL URLid; //is main key for data base table
	private String Head;
	private String Body;
	private String Meta;
	private ArrayList<URL> linkList;
	
	private MessageBox msgBox;
	
	public ParsedStuff(URL URLid) {
		this.URLid=URLid;
		linkList = new ArrayList<URL>();
	}
	
	public void addLinkToList(String url){
		URL aux=null;
		try {
			aux = new URL(URLid,url);
		} catch (MalformedURLException e) {
			//msgBox = new MessageBox("Malformed URL Exception");
			e.printStackTrace();
			System.out.println("------------------------------------------unkwon protocol");
		}
		
		if(aux!=null)linkList.add(aux);
	}
	
	public void clearLinkList(){
		linkList.clear();
	}
	
	public ArrayList<URL> getLinkList(){
		return linkList;
	}
	
	public URL getURLid() {
		return URLid;
	}

	public String getHead() {
		return Head;
	}
	public void setHead(String head) {
		Head = head;
	}
	public String getBody() {
		return Body;
	}
	public void setBody(String body) {
		Body = body;
	}
	public String getMeta() {
		return Meta;
	}
	public void setMeta(String meta) {
		Meta = meta;
	}
	
}
